package com.fingard.dsp.bank.reqrespobj.pushinfotobank;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RequestBase;
import com.fingard.dsp.bank.reqrespobj.pushinfotobank.detail.ReqPushTransInfoDetail;
import com.fingard.xml.XmlTextReader;

public class ReqPushTransInfo extends RequestBase {
    public ReqPushTransInfoDetail singleDetail = null;

    private XmlTextReader xmlReader;

    public ReqPushTransInfo(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception {
        reqHeader = p_header;
        xmlReader = p_xmlReader;
    }

    public boolean readRecord() throws Exception {
        singleDetail = null;
        if (xmlReader.read(PATH_Detail)) {//  /ATSYH/TransReq/TransParam/DetailRecord
            singleDetail = new ReqPushTransInfoDetail(xmlReader.readedXElement, reqHeader.transType, reqHeader.bankCode);
            return true;
        } else {
            return false;
        }
    }


    public String getOriReqXml() {
        return xmlReader.getOriXmlString();
    }
}
